package com.atguigu.mycloud.service;

import com.atguigu.mycloud.Enum.ReturnMessage;
import com.atguigu.mycloud.entity.Pay;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author 任浩
 * @version 1.0
 */

@FeignClient(value = "cloud-payment-service")
public interface PayFeignAPI {

    @GetMapping("/pay/get/{id}")
    public ReturnMessage<Pay> get(@PathVariable("id") Integer id);

    /**
     * Resilience4j CircuitBreaker 的例子
     * @param id
     * @return
     */
    @GetMapping(value = "/pay/circuit/{id}")
    public String myCircuit(@PathVariable("id") Integer id);

    /**
     * Resilience4j Bulkhead 的例子
     * @param id
     * @return
     */
    @GetMapping(value = "/pay/bulkhead/{id}")
    public String myBulkhead(@PathVariable("id") Integer id);

    /**
     * Resilience4j ratelimit 的例子
     * @param id
     * @return
     */
    @GetMapping(value = "pay/rateLimit/{id}")
    public String myRatelimit(@PathVariable("id") Integer id);
}
